function renderUser() {
    axios.get('http://www.itcbc.com:8080/my/user/userinfo',{
        headers: {
            Authorization: localStorage.getItem('token')
        }
    }).then(res => {
        // let {username,nickname,email} = res.data.data;
        // $('input[name=username]').val(username);
        // $('input[name=nickname]').val(nickname);
        // $('input[name=email]').val(email);
        let form = layui.form;
        form.val('abc',res.data.data)
    })
}
renderUser();
$('form').on('submit',function(e) {
    e.preventDefault();
    let data = $(this).serialize();
    // console.log(data)
    axios.post('http://www.itcbc.com:8080/my/user/userinfo',data,{
        headers: {
            Authorization: localStorage.getItem('token')
        }
    }).then(res => {
        let {status,message} = res.data;
        if(status === 0) {
            layer.msg(message);
            window.parent.getUserInfo();
        }
    })
})
$('button[type=reset]').on('click',function(e) {
    e.preventDefault();
    renderUser();
})